package com.baizhi.springmvc.service.imp;

import com.baizhi.springmvc.dao.AddressDao;
import com.baizhi.springmvc.entity.Address;
import com.baizhi.springmvc.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class AddressServiceImp implements AddressService {
    @Autowired
    private AddressDao addressDao;
    @Override
    public List<Address> selectAllAddress(Integer user_id) {
        List<Address> addressList = addressDao.selectAllAddress(user_id);
        return addressList;
    }

    @Override
    public void insert(Address address) {
        addressDao.insert(address);
    }

    @Override
    public void updateStatus(Integer status, Integer id) {
        addressDao.updateStatus(status,id);
    }

    @Override
    public void updateDeleteStatus(Integer addressid) {
        addressDao.updateDeleteStatus(addressid);
    }

    @Override
    public void updateAllStatus(Integer user_id) {
        addressDao.updateAllStatus(user_id);
    }
}
